import { request } from '@/utils/http'

export default {
  // 获取空间列表
  async getToolboxApi(payload: any) {
    const data = await request('/blade/blade/openapi/v1/core/get-child-node-brief-in-range', {
      method: 'POST',
      data: payload,
    })
    return data
  },

  // 获取用户组列表
  async getUserGroup(payload?: any) {
    const data = await request('/blade/blade/openapi/v1/core/user_group', {
      method: 'GET',
      params: payload,
    })
    return data
  },

  // 创建用户组
  async addUserGroup(payload: any) {
    const data = await request('/blade/blade/openapi/v1/core/user_group', {
      method: 'POST',
      data: payload,
    })
    return data
  },

  // 删除用户组
  async deleteUserGroup(payload: any) {
    const data = await request('/blade/blade/openapi/v1/user-group/delete', {
      method: 'POST',
      data: payload,
    })
    return data
  },

  // 获取用户用户组列表
  async getUserAndUserGroup(payload?: any) {
    const data = await request('/blade/blade/openapi/v1/user-group/user_group', {
      method: 'GET',
      params: payload,
    })
    return data
  },
}
